<include file="public/layout" />
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>管理员 - 编辑角色</h3>
                <h5>网站系统角色管理</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" action="{:U('Admin/Jurisdiction/addSave')}" id="roleform" method="post">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="role_name"><em>*</em>角色名称</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="data[name]" id="role_name" value="{$detail.name}" class="input-txt">
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="role_desc"><em> </em>角色描述</label>
                </dt>
                <dd class="opt">
                    <textarea id="role_desc" name="data[describe]" class="tarea" rows="6">{$detail.describe}</textarea>
                    <p class="notic"></p>
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" onclick="roleSubmit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
        </div>
        <input type="hidden" name="role_id" value="{$detail.role_id}">
    </form>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        $(":checkbox[cka]").click(function(){
            var $cks = $(":checkbox[ck='"+$(this).attr("cka")+"']");
            if($(this).is(':checked')){
                $cks.each(function(){$(this).prop("checked",true);});
            }else{
                $cks.each(function(){$(this).removeAttr('checked');});
            }
        });
    });

    function choosebox(o){
        var vt = $(o).is(':checked');
        if(vt){
            $('input[type=checkbox]').prop('checked',vt);
        }else{
            $('input[type=checkbox]').removeAttr('checked');
        }
    }

    function roleSubmit(){
        if($('#role_name').val() == '' ){
            layer.alert('角色名称不能为空', {icon: 2});
            return false;
        }
        $('#roleform').submit();
    }
</script>
</body>
</html>